<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>信贷分析管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
<!-- 
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/bls/loan/">信贷分析列表</a></li>
		<li class="active"><a href="${ctx}/bls/loan/form?id=${loan.id}">信贷分析<shiro:hasPermission name="bls:loan:edit">${not empty loan.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="bls:loan:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>-->
	<div class="breadcrumb"><h4>${not empty loan.id?'修改':'添加'}信贷信息</h4></div>
	<form:form id="inputForm" modelAttribute="loan" action="${ctx}/bls/loan/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		
		<tags:message content="${message}"/> 
	<div class="row">
	
		<div class="control-group span12">
			<label class="control-label"><i class="icon-th-list"></i> 所属部门:</label>
			<div class="controls">
			 <tags:treeselect id="office" name="office.id" value="${loan.office.id}" labelName="office.name" labelValue="${loan.office.name}"
					title="部门" url="/sys/office/treeData"/>
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label"><i class="icon-user"></i> 信贷人员:</label>
			<div class="controls">
				<form:input path="officerid" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label"><i class="icon-th-list"></i>信贷类别:</label>
			<div class="controls">
			<form:select path="type">
					<form:option value="" label="请选择"/>
					<form:options items="${fns:getDictList('bls_loan_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
				
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label">贷款开始日期:</label>
			
			<div class="controls">
				<div class="input-append">
					
					<input id="inputDate" name="startdate" type="text" readonly="readonly" maxlength="20" class="Wdate"
						value="<fmt:formatDate value="${loan.startdate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
				</div>
			</div>
				
		</div>
		<div class="control-group span6">
			<label class="control-label">贷款结束日期</label>
			<div class="controls">
				<div class="input-append">
					
					<input id="inputDate" name="enddate" type="text" readonly="readonly" maxlength="20" class="Wdate"
						value="<fmt:formatDate value="${loan.enddate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
				</div>
				
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label"><i class="icon-pencil"></i> 贷款金额</label>
			<div class="controls">
				<form:input path="amount" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label"><i class="icon-pencil"></i> 贷款余额</label>
			<div class="controls">
				<form:input path="balance" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label"><i class="icon-pencil"></i> 应收利息</label>
			<div class="controls">
				<form:input path="interes" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group span6">
			<label class="control-label"><i class="icon-pencil"></i> 实收利息</label>
			<div class="controls">
				<form:input path="interestactual" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group span12">
			<label class="control-label"><i class="icon-pencil"></i> 未收利息</label>
			<div class="controls">
				<form:input path="interestbalance" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		
	</div>
		<div class="form-actions">
			<shiro:hasPermission name="bls:loan:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
